﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/MasterPage.Master"  AutoEventWireup="true" CodeBehind="BGM_Approve_Project.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.Form.BGM_Approve_Project" enableEventValidation="false" %>

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<%@ Register Assembly="BasicFrame.WebControls.BasicDatePicker" Namespace="BasicFrame.WebControls" TagPrefix="BDP" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
    
        function openProjectDetails(id) {
            var type = document.getElementById("<%= hdType.ClientID %>").value;
            var comboYear = $find('<%= ddlYear.ClientID %>');
            var oWnd = radopen("BGM_Project.aspx?year=" + comboYear.get_value() + "&id=" + id + "&type=" + type, "Approval");
            return false;
        }

        function closeRadWindow(sender, args) {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest('refresh');
        }

        function onTextChange(sender) {
            if (sender.get_value() == "") {
                sender.set_text("");
            }
        }

        function HideTooltipCurrent() {
            var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();
            if (tooltip) tooltip.hide();
        }

    </script>
 </telerik:RadCodeBlock>
 
     <telerik:RadWindowManager 
        ID="RadWindowManager1" 
        ShowContentDuringLoad="false" 
        VisibleStatusbar="false" 
        ReloadOnShow="true" 
        runat="server" 
        Skin="Web20" 
        Modal="true" 
        KeepInScreenBounds="true" 
        Style="z-index: 7001">
        <Windows>
            <telerik:RadWindow 
                ID="Approval" 
                runat="server" 
                Width="1024px" 
                Height="590px"
                Behaviors="Reload, Close"
                OnClientClose="closeRadWindow">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>  

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None"  > 
    </telerik:RadAjaxLoadingPanel>
    
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ddlYear">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlPrjHeader" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="lstReq" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="lstApp" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="btnSave" />
               </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ddlPrjHeader">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lstReq" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="lstApp" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="btnSave" />
               </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnSelect">
                 <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lstReq" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="lstApp" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="btnSave" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnSelectAll">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lstReq" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="lstApp" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="btnSave" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnRemove">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lstReq" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="lstApp" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="btnSave" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnRemoveAll">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lstReq" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="lstApp" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="btnSave" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlYear" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="ddlPrjHeader" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="lstReq" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="lstApp" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="btnSave" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            
            <telerik:AjaxSetting AjaxControlID="btnCancel">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlYear" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="ddlPrjHeader" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="lstReq" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="lstApp" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="btnSave" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

<link rel="StyleSheet" href="../../Styles/StyleSheet.css" type="text/css">

<table style="width: 980px; height: 100%;">
    <tr>
    <td valign="top">
        <div class="Background980">
            <div class="BackgroundBottom980">
            <table width="100%">
                <tr>
                    <td width="13%" align="left">
                        ปีงบประมาณ :
                    </td>
                    <td width="37%" align="left">
                        <telerik:RadComboBox ID="ddlYear" runat="server" Width="150px" 
                            onselectedindexchanged="ddlYear_SelectedIndexChanged" AutoPostBack="True">
                            <Items>
                            </Items>
                        </telerik:RadComboBox>
                    </td>     
                    <td width="25%" align="left">
                        หัวข้อการประชุมพิจารณางบประมาณ :
                    </td>
                    <td width="25%" align="left">
                        <telerik:RadComboBox ID="ddlPrjHeader" runat="server" 
                            AllowCustomText="true" CausesValidation="false" DataTextField="text" 
                            DataValueField="value" EmptyMessage="---- พิมพ์ที่นี่เพื่อค้นหากิจกรรมย่อย ----"
                            Filter="Contains" OnClientTextChange="onTextChange" Width="300px"
                            onselectedindexchanged="ddlPrjHeader_SelectedIndexChanged" AutoPostBack="True">
                        </telerik:RadComboBox>
                    </td>
                </tr>

            </table>
            

            </div>
        </div>  
    </td>
    </tr>
    <td valign = "top" colspan="2">
        <div class="Background980">
            <div class="BackgroundBottom980">
                <asp:Panel ID="panel1" runat="server" ScrollBars="Auto">
                    <table width="100%">
                        <tr>
                            <td align="left">
                                <br />
                                <div class="header-grid">
                                    <div class="defaultFont">
                                        <asp:Label ID="lbTable" runat="server" Text=""></asp:Label> 
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Panel ID="panelList" runat="server" Height="310px" ScrollBars="Auto">
                    <asp:Label ID="lblHeader_seq" runat="server" Visible="False"></asp:Label>
                    <asp:HiddenField ID="hdType" runat="server" />
                    <asp:HiddenField ID="hdfHeaderType" runat="server" />
                    <div>
                    </div>
                    <table width="100%">
                        <tr>
                            <td align="center" style="padding-top: 5px" width="45%">
                                <asp:ListBox ID="lstReq" runat="server" Width="97%" Height="270px" 
                                    SelectionMode="Multiple"></asp:ListBox>
                            </td>
                            <td align="center"  style="padding-top: 5px">
                                <asp:Button ID="btnSelect" runat="server" Text=">"  OnClick="btnSelect_Cleck"/>
                                <br />
                                <br />
                                <asp:Button ID="btnSelectAll" runat="server" Text=">>>" OnClick="btnSelectAll_Cleck" />
                                <br />
                                <br />
                                <asp:Button ID="btnRemove" runat="server" Text="<" OnClick="btnRemove_Cleck" />
                                <br />
                                <br />
                                <asp:Button ID="btnRemoveAll" runat="server" Text="<<<" OnClick="btnRemoveAll_Cleck" />
                            </td>
                            <td align="center" style="padding-top: 5px" width="45%">
                                <asp:ListBox ID="lstApp" runat="server" Width="97%" Height="270px" 
                                    SelectionMode="Multiple"></asp:ListBox>
                            </td>
                        </tr>
                    </table>
                    <table width="100%">
                        <tr>
                        <td width="50%" align="right">
                            <asp:Button ID="btnSave" runat="server" Text="ตีกลับ" Enabled="False" OnClick="btnSave_Cleck" Width="100" />
                        </td>
                        <td width="50%">
                            <asp:Button ID="btnCancel" runat="server" Text="ยกเลิก" OnClick="btnCancel_Cleck" Width="100" />
                        </td>
                        </tr>
                    </table>
                </asp:Panel>
            </div>
        </div>
    </td>
    </tr>
</table>
    
</asp:Content>
